package com.cskaoyan.utils;

import com.cskaoyan.bean.entity.Order;
import com.cskaoyan.bean.entity.OrderExample;
import org.springframework.stereotype.Component;
import java.util.List;

@Component
public class GetDiffOrderExampleAccordingToOrderStatusUtil {


    public static OrderExample getStatusExample(Integer userId,String orderStatus){
        OrderExample orderExample = new OrderExample();
        OrderExample.Criteria orderExampleCriteria = orderExample.createCriteria();
        if(userId != null){
            orderExampleCriteria.andUserIdEqualTo(userId);
        }
        orderExampleCriteria.andOrderStatusEqualTo(Short.parseShort(orderStatus));
        return orderExample;
    }
}
